﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using ClassLibrary;
using NetworkNode.Switching;

namespace Test
{
    class A
    {
        
        private class _B : B
        {
            public void setA(int s)
            {
                a = s;
            }
        }

        private _B s;

        public B getB()
        {
            s = new _B();
            return s;
        }

        public void setB(int z)
        {
            s.setA(z);
        }

    }
    class B
    {
        protected int a = 2;
        public int getA()
        {
            return a;
        }
    }

    class D
    {
        protected bool Equals(D other)
        {
            return S == other.S && string.Equals(Fg, other.Fg);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return (S*397) ^ (Fg != null ? Fg.GetHashCode() : 0);
            }
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((D) obj);
        }
        public int S { get;  set; }
        public string Fg { get;  set; }
    }
   
    public class Program
    {

        static void Main(string[] args)
        {
            D sss = new D() {Fg = "Marc", S = 5};
            D f = new D() {Fg = "Marc", S = 5};
            Console.WriteLine(sss.Equals(f));

            StringBuilder stringBuilder = new StringBuilder();
            System.Console.WriteLine(stringBuilder.ToString().Length);
            A a = new A();
            B b = a.getB();

            Console.WriteLine(b.getA());
            a.setB(4);
            Console.WriteLine(b.GetType().ToString());
            Console.Read();

        }
    }
}
